﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GalaSoft.MvvmLight.Command;

namespace TriviaViewModels
{
    public class EntryViewModelWizard:WizardViewBase
    {
        /// <summary>
        /// binded to the text box of user name
        /// </summary>
        private string _usereNam;
        public string UserName
        {
            get { return _usereNam; }
            set
            {
                if (_usereNam != value)
                {
                    _usereNam = value;
                    RaisePropertyChanged("UserName");
                }

            }
        }
        /// <summary>
        /// binded to visibility property, wheter the isabout visible
        /// </summary>

        /// <summary>
        /// binded to the textbox of password
        /// </summary>
        private string _password;
        public string Password
        {
            get { return _password; }
            set
            {
                if (_password != value)
                {
                    _password = value;
                    RaisePropertyChanged("Password");
                }

            }
        }
        /// <summary>
        /// binding the list of topics in the combo box
        /// </summary>
        private List<string> _topics;
        public List<string> Topics
        {
            get { return _topics; }
            set
            {
                if (_topics != value)
                {
                    _topics = value;
                    RaisePropertyChanged("Topics");
                }
            }
        }
        /// <summary>
        ///  property that binds to the selected type of the combobox of type of questions
        /// </summary>
        private string _selectedTopic;
        public string SelectedTopic
        {
            get { return _selectedTopic; }
            set
            {
                if (_selectedTopic != value)
                {
                    _selectedTopic = value;
                    RaisePropertyChanged("SelectedTopic");
                }
            }
        }
        /// <summary>
        ///  property that binds to the selected difficulty of the combobox of type of questions
        /// </summary>
        private string _selectedDifficulty;
        public string SelectedDifficulty
        {
            get { return _selectedDifficulty; }
            set
            {
                if (_selectedDifficulty != value)
                {
                    _selectedDifficulty = value;
                    RaisePropertyChanged("SelectedDifficulty");
                }
            }
        }

        /// <summary>
        /// binding the list of difficulties in the combo box
        /// </summary>
        private List<string> _difficulties;
        public List<string> Difficulties
        {
            get { return _difficulties; }
            set
            {
                if (_difficulties != value)
                {
                    _difficulties = value;
                    RaisePropertyChanged("Difficulties");
                }
            }
        }

        public EntryViewModelWizard()
        {
            using (var proxy = new ServiceReference1.GameServiceClient())
            {
                Topics = proxy.GetTopics().ToList();
                Difficulties = proxy.GetDificulties().ToList();
            }

        }

        /// <summary>
        /// Commands that initiates the game with a user or without
        /// </summary>

        /// <summary>
        /// Command to show and hide the about label, 
        /// </summary>



        private RelayCommand _showSocreBoard;
        public RelayCommand ShowSocreBoard
        {
            get
            {
                if (_showSocreBoard == null)
                {
                    _showSocreBoard = new RelayCommand(() =>
                    {
                        var scoreboardmodel = new ScoreBoardViewModelWizard();



                    });
                } return _showSocreBoard;
            }
            set
            {
                if (_showSocreBoard != value)
                {
                    _showSocreBoard = value;
                    RaisePropertyChanged("ShowSocreBoard");
                }
            }

        }

    }
}
